#ifndef SPEEDOMETERCONTROLLER_H
#define SPEEDOMETERCONTROLLER_H

#include <QWidget>
#include "../../view/trainInformation/speedometerview.h"
#include <QDebug>
#include <QTimer>              //时间类
#include <QDateTime>           //日期时间类
#include "../../model/trainInformation/speedometermodel.h"



class SpeedometerController : public QObject
{
    Q_OBJECT
public:
    SpeedometerController(QObject *parent = nullptr);
    //速度模块
    SpeedometerView *speedometerView;
public:
    void show(QVBoxLayout *vLayout,int w);
    //列出的运动状态
    void setTrainRunState(TrainRunState state,int dwellTime,int distance);
    void setDistanceString(int distance);//更新距离
    void setProgressBar(int distance);//更新进度条距离
    void setStationLabel(float station);//站距离

    void setAccelerateFun();
    void setRetardFun();
private:
    int dwellTime;//停留时间
    QTimer *obj_timer;//倒计时
    int distanceTime;//到站距离
    QTimer *distance_timer;//测试距离倒计时



private:
    //设置停留时间
    void setDwellTime(QString text);
private slots:
    void timeout_slot();
    void distance_slot();
signals:

};

#endif // SPEEDOMETERCONTROLLER_H
